﻿<%@ Page Language="c#" CodeBehind="CalendarView.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.Schedule.CalendarViewPage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
  <title>CalendarList</title>
  <script language="javascript">
  //<!--
		function dialwinprocess(CurrDate,CurrTime,whichPg,TaskID)
			{
			   if(whichPg==1)
				var newdialoguewin = window.showModalDialog("Manage.aspx?CurrDate="+CurrDate+"&CurrTime="+CurrTime,window,"dialogWidth:1000px;DialogHeight=700px;status:no");
			   else
			   var newdialoguewin = window.showModalDialog("TaskDetail.aspx?TaskID="+TaskID,window,"dialogWidth:1000px;DialogHeight=700px;status:no");
			}
	


			
		var ball1 = new Image();
		var ball2 = new Image();
		ball1.src = 'images/ball1.gif';
		ball2.src = 'images/ball2.gif';

		var active = new Image();
		var nonactive = new Image();
		active.src = '../../../images/maillistbutton2.gif';
		nonactive.src = '../../../images/maillistbutton1.gif';

		function onMouseOver(img)
		{
			document.images[img].src = ball2.src;
		}

		function onMouseOut(img)
		{
			document.images[img].src = ball1.src;
		}

		function onOverBar(bar)
		{
			if (bar != null) {
				bar.style.backgroundImage = "url("+active.src+")";
				
			}
		}

		function onOutBar(bar)
		{
			if (bar != null) {
				bar.style.backgroundImage = "url("+nonactive.src+")";
			}
		}
		
		function selectAll(){
			var len=document.MailList.elements.length;
			var i;
		    for (i=0;i<len;i++){
			if (document.MailList.elements[i].type=="checkbox"){
		        document.MailList.elements[i].checked=true;								
						 }
					}
				}

		function unSelectAll(){
	          var len=document.MailList.elements.length;
	          var i;
	          for (i=0;i<len;i++){
	               if (document.MailList.elements[i].type=="checkbox"){
	                  document.MailList.elements[i].checked=false; 
	               }   
	        	 } 
		    }
  //-->
  </script>
  <style>
    A.linkFooter:link { font-weight: normal; font-size: 9px; color: #646464; font-family: Arial, Helvetica, sans-serif; text-decoration: none; }
    A.linkFooter:visited { font-weight: normal; font-size: 9px; color: #646464; font-family: Arial, Helvetica, sans-serif; text-decoration: none; }
    A.linkFooter:hover { font-weight: normal; font-size: 9px; color: #646464; font-family: Arial, Helvetica, sans-serif; text-decoration: underline; }
    A.linkFooter:active { font-weight: normal; font-size: 10pt; color: #646464; line-height: 25px; font-family: "宋体"; text-decoration: none; }
    A.linkMenu:link { font-weight: normal; font-size: 9pt; color: #838383; font-family: Arial, Helvetica, sans-serif; text-decoration: none; }
    A.linkMenu:visited { font-weight: normal; font-size: 9pt; color: #838383; font-family: Arial, Helvetica, sans-serif; text-decoration: none; }
    A.linkMenu:active { font-weight: normal; font-size: 9pt; color: #838383; line-height: 10px; font-family: "宋体"; text-decoration: underline; }
    A.linkMenu:hover { font-weight: normal; font-size: 9px; color: #ffffff; font-family: Arial, Helvetica, sans-serif; text-decoration: none; }
    .borderMenuLayer { border-left-color: #c9c9c9; border-bottom-color: #c9c9c9; border-top-color: #c9c9c9; border-right-color: #c9c9c9; }
    .borderMenuLayerOver { font-size: 9pt; border-left-color: #949494; border-bottom-color: #949494; border-top-color: #949494; border-right-color: #949494; }
    .textWhite { font-weight: normal; font-size: 9pt; color: #999999; line-height: 22px; font-family: "宋体"; }
    .top { font-weight: normal; font-size: 9pt; color: #000000; font-family: "Arial" , "Helvetica" , "sans-serif"; text-decoration: none; }
  </style>
</head>
<body>
  <form id="CalendarList" method="post" runat="server">
    <asp:DropDownList ID="listStaff" Style="z-index: 102; left: 487px; position: absolute; top: 293px" runat="server" AutoPostBack="True" Visible="False" />
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
      <tr>
        <td>
          <table id="tblContainer" height="25" cellspacing="0" cellpadding="0" width="100%" border="0" runat="server">
            <tr>
              <td id="bar1" align="middle" width="90" background="../../images/maillistbutton1.gif">&nbsp;<asp:LinkButton ID="lnkbtnToday" runat="server" ForeColor="Black" BackColor="Transparent" Font-Size="X-Small">今日未完成</asp:LinkButton></td>
              <td id="bar2" align="middle" width="90" background="../../images/maillistbutton1.gif">&nbsp;<asp:LinkButton ID="lnkbtnHistory" runat="server" ForeColor="Black" BackColor="Transparent" Font-Size="X-Small">历史未完成</asp:LinkButton></td>
              <td id="bar3" align="middle" width="90" background="../../images/maillistbutton1.gif">
                <asp:LinkButton ID="lnkbtnFinished" runat="server" ForeColor="Black" BackColor="Transparent" Font-Size="X-Small">已完成</asp:LinkButton>
              </td>
              <td>
                <asp:LinkButton ID="lnkbtnReturn" runat="server" Visible="False" Font-Size="X-Small">返回</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="lnkbtnNew" runat="server" Font-Size="X-Small">新建</asp:LinkButton>&nbsp;&nbsp;
                <asp:LinkButton ID="lnkbtnAccept" runat="server" Visible="False" Font-Size="X-Small">接受</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="lnkbtnCancel" runat="server" Visible="False" Font-Size="X-Small">取消</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="lnkbtnFinish" runat="server" Visible="False" Font-Size="X-Small">完成</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="lnkbtnAdd" runat="server" Visible="False" Font-Size="X-Small">任务安排</asp:LinkButton>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>
          <asp:Table ID="Table1" runat="server" Width="711px" Height="195px" BorderWidth="0px" />
          <asp:DataGrid ID="dgList" runat="server" BackColor="White" Width="100%" BorderWidth="1px" BorderColor="#93BEE2" CssClass="top" DataKeyField="ID" OnPageIndexChanged="DataGrid_PageChanged" PagerStyle-HorizontalAlign="Right" PagerStyle-Mode="NumericPages" AutoGenerateColumns="False" CellPadding="3" AllowPaging="True" PageSize="15">
            <AlternatingItemStyle BackColor="#E8F4FF"></AlternatingItemStyle>
            <ItemStyle HorizontalAlign="Center"></ItemStyle>
            <HeaderStyle ForeColor="White" BackColor="#337FB2"></HeaderStyle>
            <FooterStyle HorizontalAlign="Center"></FooterStyle>
            <Columns>
              <asp:TemplateColumn HeaderText="选择">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle Font-Size="X-Small" HorizontalAlign="Center" Height="20px" Width="60px"></ItemStyle>
                <ItemTemplate>
                  <asp:CheckBox ID="grpID" Checked="False" runat="server" />
                </ItemTemplate>
              </asp:TemplateColumn>
              <asp:TemplateColumn HeaderText="日期">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                <ItemTemplate>
                  <asp:Label runat="server" Text='<%# Convert.ToDateTime(DataBinder.Eval(Container, "DataItem.Date").ToString()).ToShortDateString() %>' />
                </ItemTemplate>
              </asp:TemplateColumn>
              <asp:TemplateColumn HeaderText="时段">
                <HeaderStyle HorizontalAlign="Center" Width="80px"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                <ItemTemplate>
                  <asp:Label runat="server" Text='<%# GetPeriodByPeriodID(DataBinder.Eval(Container, "DataItem.beginPeriodID").ToString(),(DataBinder.Eval(Container, "DataItem.endPeriodID").ToString())) %>' />
                </ItemTemplate>
              </asp:TemplateColumn>
              <asp:TemplateColumn HeaderText="内容">
                <HeaderStyle HorizontalAlign="Center" Width="140px"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                <ItemTemplate>
                  <a href="#" onclick='javascript:return dialwinprocess("","","2","<%# DataBinder.Eval(Container, "DataItem.TaskID") %>")'><asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Subject") %>' /></a>
                </ItemTemplate>
              </asp:TemplateColumn>
              <asp:TemplateColumn HeaderText="状态">
                <HeaderStyle HorizontalAlign="Center" Width="50px"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                <ItemTemplate>
                  <asp:Label runat="server" Text='<%# GetStatus(DataBinder.Eval(Container, "DataItem.IsConfirm").ToString()) %>' />
                </ItemTemplate>
              </asp:TemplateColumn>
              <asp:BoundColumn DataField="CooperatorList" HeaderText="协同人员">
                <HeaderStyle HorizontalAlign="Center" Width="250px"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
              </asp:BoundColumn>
            </Columns>
            <PagerStyle HorizontalAlign="Right" BackColor="#E8F4FF" Mode="NumericPages"></PagerStyle>
          </asp:DataGrid>
        </td>
      </tr>
      <tr>
        <td style="width: 150px">&nbsp;&nbsp;</td>
      </tr>
    </table>
  </form>
  <script language="javascript">
		//<!--
		// 高亮背景
		function high( which )
		{ 
			which.style.background = "#87F977";
			which.style.font.color = "#000000";
		}
		// 取消背景高亮
		function low( which )
		{ 
			which.style.background = "#FFF8F7";
			which.style.font.color = "#000000";
		}
		//-->
  </script>
</body>
</html>
